package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Objects;

@TableName("t_permission")
@Data
public class SysPermission {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private Integer parent_id;
    private String name;
    private String path;
    private String components;
    private String icon;
    private String title;
    private Byte meta;
    private Byte hidden;
//    private String redirect;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SysPermission that = (SysPermission) o;
        return path.equals(that.path);
    }

    @Override
    public int hashCode() {
        return Objects.hash(path);
    }
}
